home *** CD-ROM | disk | FTP | other *** search
- /* Using the if statement. */
- using System;
-
- namespace Chapter2 {
- class Class1 {
- static void Main() {
- int cResponse;
-
- // Step 1
- Console.Write("Input <Y> for YES: ");
-
- // Step 2
- cResponse = Console.Read();
-
- // Step 3 - if response equals 'Y'
- if ((char) cResponse == 'Y')
- Console.WriteLine("\n You typed Y\n");
- }
- }
- }
-
-